package com.zzuli.ylsystem.dao;

import com.zzuli.ylsystem.entity.Sickdays;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface SickdaysDao {
    int deleteByPrimaryKey(Integer id);

    int insert(Sickdays record);

    int insertSelective(Sickdays record);

    Sickdays selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Sickdays record);

    int updateByPrimaryKey(Sickdays record);

    @Select("select days from sickdays where user=#{id}")
    Integer selectSickByUser(Integer id);

    @Select("select time from sickdays where user=#{id}")
    String selectSickTimeByUser(Integer id);

    @Update("update sickdays set days=#{daySub} where user=#{id}")
    void updateUserSickDays(Integer id, int daySub);

    @Select("select count(*) from sickdays where user=#{id}")
    int selectAll(Integer id);
}